ORACLE的建表语句


DROP TABLE ${de.tableName} CASCADE CONSTRAINTS;
CREATE TABLE ${de.tableName}
(
		<#list columnEntitys as columnEntity>
		<#if columnEntity.columnTyp=='VARCHAR'>
				${columnEntity.columnNam}    VARCHAR2(${columnEntity.precision?c} CHAR)          <#if columnEntity.required==true>NOT NULL</#if><#if columnEntity_has_next>,</#if>
		<#else>
						<#if columnEntity.columnTyp=='NUMERIC'>
								${columnEntity.columnNam}    NUMBER(${columnEntity.precision?c},${columnEntity.scale})          <#if columnEntity.required==true>NOT NULL</#if><#if columnEntity_has_next>,</#if>
						 <#else>
								<#if columnEntity.columnTyp=='TIMESTAMP'>
										${columnEntity.columnNam}    TIMESTAMP(6)          <#if columnEntity.required==true>NOT NULL</#if><#if columnEntity_has_next>,</#if>
										<#else>
										${columnEntity.columnNam}    ${columnEntity.columnTyp}          <#if columnEntity.required==true>NOT NULL</#if><#if columnEntity_has_next>,</#if>
								</#if>			
				        </#if>
		</#if>
	</#list>
);
COMMENT ON TABLE ${de.tableName} IS '${de.tableComment}';
<#list columnEntitys as columnEntity>	
	COMMENT ON COLUMN ${de.tableName}.${columnEntity.columnNam} IS '${columnEntity.entityColumnComment}';	
</#list>


<#list columnEntitys as columnEntity>	
<#if columnEntity.key==true>
CREATE UNIQUE INDEX PK_${de.tableName} ON ${de.tableName}
(${columnEntity.columnNam});

ALTER TABLE ${de.tableName} ADD (
		  CONSTRAINT PK_${de.tableName}
		  PRIMARY KEY
(${columnEntity.columnNam}));
</#if>
</#list>





MySQL的建表语句
DROP TABLE IF EXISTS `${de.tableName}`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `${de.tableName}` (
		<#list columnEntitys as columnEntity>	
		<#if columnEntity.key==true>
		  PRIMARY KEY (`${columnEntity.columnNam}`),
		</#if>		
		<#if columnEntity.columnTyp=='VARCHAR'>
		${columnEntity.columnNam}    VARCHAR(${columnEntity.precision?c})          <#if columnEntity.required==true>NOT NULL</#if> COMMENT '${columnEntity.entityColumnComment}'<#if columnEntity_has_next>,</#if>
<#else>
				<#if columnEntity.columnTyp=='NUMERIC'>
						${columnEntity.columnNam}    decimal(${columnEntity.precision?c},${columnEntity.scale})          <#if columnEntity.required==true>NOT NULL</#if> COMMENT '${columnEntity.entityColumnComment}'<#if columnEntity_has_next>,</#if>
				 <#else>
						<#if columnEntity.columnTyp=='TIMESTAMP'>
								${columnEntity.columnNam}    datetime(6)          <#if columnEntity.required==true>NOT NULL</#if> COMMENT '${columnEntity.entityColumnComment}'<#if columnEntity_has_next>,</#if>
								<#else>
								${columnEntity.columnNam}    ${columnEntity.columnTyp}          <#if columnEntity.required==true>NOT NULL</#if> COMMENT '${columnEntity.entityColumnComment}'<#if columnEntity_has_next>,</#if>
						</#if>			
		        </#if>
</#if>
</#list>
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='${de.tableComment}';



<#list columnEntitys as columnEntity>
${columnEntity.columnNam}
</#list>
<#list columnEntitys as columnEntity>
${columnEntity.entityColumnComment}
</#list>
<#list columnEntitys as columnEntity>
${columnEntity.columnTyp}(${columnEntity.precision?c})
</#list>




<#list columnEntitys as columnEntity>
<li>
                                    <div class="item-content">
                                        <div class="item-inner">
                                            <div class="item-title label" style=" width:28%">${columnEntity.entityColumnComment}</div>
                                            <div class="item-input">
                                                <input type="text" placeholder="${columnEntity.entityColumnComment}" id="${columnEntity.entityColumnNam}" name="${columnEntity.entityColumnNam}"
                                                       style="display: inline; width: 85%;"/>
                                            </div>
                                        </div>
                                    </div>
                                </li>
                                </#list>